home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / fido / XPACK275.lha / rexx / Xkill.rexx < prev    next >
OS/2 REXX Batch file  |  1994-05-10  |  1KB  |  41 lines

  1. /**/
  2. v="$VER: Xkill Rexx  Remove files from site queues Williamson 56.00"
  3. parse upper arg site_pattern file_pattern .
  4. if arg()=0 then do
  5.     Say "Xkill v"right(v,5)" site_pattern file_pattern"
  6.     Say "      eg:  #?151#? #?(LHA|TIC)"
  7.     exit
  8. end
  9. sitelist=XfqGetSiteList()
  10. call XfqWalkSession(sitelist,sites)
  11. Say "There are "sites.NUMENTRIES" sites in the queue"
  12. do loop=1 to sites.NUMENTRIES
  13.     addrtags.XQ_Mandatory=511;addrtags.XQ_Optional=511
  14.     System=XfqPutAddress(sites.loop,addrtags)
  15.     if ~MatchPattern(site_pattern,upper(System),'N') then iterate
  16.     call XfqWalkQueue(sites.loop,sitework)
  17.     Say "There are "sitework.NUMENTRIES" files for "System
  18.     do i=1 to sitework.NUMENTRIES
  19.         Say "Found "sitework.i.NAME" as "sitework.i.ASNAME" at priority "sitework.i.PRI
  20.         if ~EXISTS(sitework.i.NAME) then do
  21.             Say "File "sitework.i.NAME" does not exist"
  22.             call remove()
  23.         end
  24.         else if MatchPattern(file_pattern,sitework.i.NAME) then call remove()
  25.     end
  26. end
  27. call XfqDropObject(sitelist)  
  28. call XfqClose()
  29. exit
  30.  
  31. remove:
  32.     options prompt "Remove "sitework.i.NAME"? y/N"
  33.     parse pull resp
  34.     if upper(resp)="Y" then do
  35.         FINDIT.XQ_NAME=sitework.i.NAME;FINDIT.XQ_SITE=sites.loop
  36.         work=NULL;work=XfqFindWork(FINDIT)
  37.         if(work=NULL) then Say "Already removed by another process"
  38.         else call XfqRemoveWork(work)
  39.     end
  40. return
  41.